﻿using System.Collections.Generic;
using Bussiness.Model;
using Bussiness.Service.Base;
using NHibernate;
using NHibernate.Criterion;

namespace Bussiness.Service.Impl {
    internal class CategoryServiceImpl : BaseService<Category, long>, ICategoryService {
        public IList<Category> GetRootCategorys()
        {
            ICriteria criteria = CreateCriteria();
            return criteria.Add(Restrictions.IsNull("Parent")).List<Category>();
        }
    }
}